package com.producteev4j.services.version0;

import com.producteev4j.model.response.DashBoard;
import com.producteev4j.model.response.DashBoardWrapper;
import com.producteev4j.transport.ProducteevTransport;
import com.producteev4j.exceptions.ProducteevException;
import com.producteev4j.model.response.TaskWrapper;
import com.producteev4j.model.response.UserWrapper;

import java.util.Date;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: jcarrey
 * Date: 3/07/11
 * Time: 11:39
 * To change this template use File | Settings | File Templates.
 */
public interface ProducteevDashboardService {


    DashBoard createDashboard(ProducteevTransport transport, String userToken, String title) throws ProducteevException;

    DashBoard getDashboard(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;

    List<? extends DashBoardWrapper> getDashboards(ProducteevTransport transport, String userToken, Date since, Integer page) throws ProducteevException;

    List<? extends UserWrapper> getDashboardAccess(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;

    DashBoard leaveOrDelegateDashboard(ProducteevTransport transport, String userToken, long idDashboard, Long idUser, Long idDelegate) throws ProducteevException;

    DashBoard setTitle(ProducteevTransport transport, String userToken, long idDashboard, String title) throws ProducteevException;

    /**
     * set value of label_manager_auto
     *
     * @param transport
     * @param idDashboard
     * @param value       - 0 = DEACTIVATED, 1 = ACTIVATED
     * @return
     */
    DashBoard setSmartLabels(ProducteevTransport transport, String userToken, long idDashboard, int value) throws ProducteevException;

    boolean deleteDashboard(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;

    List<? extends TaskWrapper> getDashboardTasks(ProducteevTransport transport, String userToken, long idDashboard, Date since, Integer page) throws ProducteevException;

    /**
     * Confirm invitation to dashboard
     *
     * @param transport
     * @param idDashboard
     * @return
     */
    DashBoard confirmInvitation(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;

    DashBoard refuseInvitation(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;

    DashBoard inviteUserById(ProducteevTransport transport, String userToken, long idDashboard, long idUserTo) throws ProducteevException;

    DashBoard inviteUserByEmail(ProducteevTransport transport, String userToken, long idDashboard, String email) throws ProducteevException;


    List<? extends DashBoardWrapper> getDashboardsToUpgrade(ProducteevTransport transport, String userToken) throws ProducteevException;

    boolean needsUpgrade(ProducteevTransport transport, String userToken, long idDashboard) throws ProducteevException;


}
